<template>
  <el-dialog
    title="问卷详情"
    :visible.sync="visible"
    width="60%"
    append-to-body
  >
    <questionnaireInfo :id="id"></questionnaireInfo>
  </el-dialog>
</template>

<script>
import { mapGetters } from 'vuex';
import questionnaireInfo from './questionnaireInfo';

export default {
  name: 'QuestionaireInfo',
  components: { questionnaireInfo },
  props: {
    id: {
      type: [Object, String],
    },
    value: {
      type: Boolean,
      default: false,
    },
    dataObj: { type: [Object] },
  },
  data() {
    return {
      form: {},
      loading: false,
    };
  },
  computed: {
    visible: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit('input', val);
      },
    },
    ...mapGetters(['userInfo', 'access_token']),
  },
  watch: {
    visible(val) {
      if (val) {
        // this.form = { ...this.dataObj };
      } else {
        this.$refs.addForm && this.$refs.addForm.resetForm();
      }
    },
  },
  methods: {},
};
</script>

<style lang='scss' scoped>
</style>
